﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using ThreeDWorld;

namespace Demo
{
    public partial class MainPage : UserControl
    {
        Game1 _Game;

        public MainPage()
        {
            InitializeComponent();

            Input.SetSource(this);

            _Game = new Game1();
        }

        private void DrawingSurface_Loaded(object sender, RoutedEventArgs e)
        {

        }

        private void DrawingSurface_Draw(object sender, DrawEventArgs e)
        {
            _Game.OnDraw(e);
        }

        private void DrawingSurface_Unloaded(object sender, RoutedEventArgs e)
        {
            _Game.Dispose();
        }
    }
}
